package huixue.cn.com.rxapp.stock.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

/**
 * Created by gongdongyang on 2018/8/16.
 */

public class CommonViewHolder extends RecyclerView.ViewHolder {

    public CommonViewHolder(View itemView) {
        super(itemView);
    }

    public <T extends View> T getView(int viewId) {
       View view = itemView.findViewById(viewId);

       return (T)view;
    }

    public CommonViewHolder setText(int viewId, CharSequence text) {
        TextView tv = getView(viewId);
        tv.setText(text);
        return this;
    }
}
